//
// Created by RM UI Designer
//

#include "ui_g_Ungroup_0.h"
#include "FreeRTOS.h"
#include "cmsis_os.h"
#include "stdarg.h"
#include "stm32f4xx.h"
#include "task.h"  //vTaskDelay
#include "usart.h"

#define FRAME_ID 0
#define GROUP_ID 0
#define START_ID 0
#define OBJ_NUM 5
#define FRAME_OBJ_NUM 5

CAT(ui_, CAT(FRAME_OBJ_NUM, _frame_t)) ui_g_Ungroup_0;
ui_interface_line_t *ui_g_Ungroup_l1 = (ui_interface_line_t *)&(ui_g_Ungroup_0.data[0]);
ui_interface_line_t *ui_g_Ungroup_l2 = (ui_interface_line_t *)&(ui_g_Ungroup_0.data[1]);
ui_interface_line_t *ui_g_Ungroup_l3 = (ui_interface_line_t *)&(ui_g_Ungroup_0.data[2]);
ui_interface_line_t *ui_g_Ungroup_l4 = (ui_interface_line_t *)&(ui_g_Ungroup_0.data[3]);
ui_interface_line_t *ui_g_Ungroup_l5 = (ui_interface_line_t *)&(ui_g_Ungroup_0.data[4]);

void _ui_init_g_Ungroup_0() {
    for (int i = 0; i < OBJ_NUM; i++) {
        ui_g_Ungroup_0.data[i].figure_name[0] = FRAME_ID;
        ui_g_Ungroup_0.data[i].figure_name[1] = GROUP_ID;
        ui_g_Ungroup_0.data[i].figure_name[2] = i + START_ID;
        ui_g_Ungroup_0.data[i].operate_tpyel = 1;
    }
    for (int i = OBJ_NUM; i < FRAME_OBJ_NUM; i++) {
        ui_g_Ungroup_0.data[i].operate_tpyel = 0;
    }

    ui_g_Ungroup_l1->figure_tpye = 0;
    ui_g_Ungroup_l1->layer = 0;
    ui_g_Ungroup_l1->start_x = 831;
    ui_g_Ungroup_l1->start_y = 602;
    ui_g_Ungroup_l1->end_x = 1008;
    ui_g_Ungroup_l1->end_y = 602;
    ui_g_Ungroup_l1->color = 2;
    ui_g_Ungroup_l1->width = 1;

    ui_g_Ungroup_l2->figure_tpye = 0;
    ui_g_Ungroup_l2->layer = 0;
    ui_g_Ungroup_l2->start_x = 886;
    ui_g_Ungroup_l2->start_y = 535;
    ui_g_Ungroup_l2->end_x = 957;
    ui_g_Ungroup_l2->end_y = 535;
    ui_g_Ungroup_l2->color = 2;
    ui_g_Ungroup_l2->width = 1;

    ui_g_Ungroup_l3->figure_tpye = 0;
    ui_g_Ungroup_l3->layer = 0;
    ui_g_Ungroup_l3->start_x = 825;
    ui_g_Ungroup_l3->start_y = 501;
    ui_g_Ungroup_l3->end_x = 1015;
    ui_g_Ungroup_l3->end_y = 501;
    ui_g_Ungroup_l3->color = 2;
    ui_g_Ungroup_l3->width = 1;

    ui_g_Ungroup_l4->figure_tpye = 0;
    ui_g_Ungroup_l4->layer = 0;
    ui_g_Ungroup_l4->start_x = 866;
    ui_g_Ungroup_l4->start_y = 583;
    ui_g_Ungroup_l4->end_x = 973;
    ui_g_Ungroup_l4->end_y = 583;
    ui_g_Ungroup_l4->color = 2;
    ui_g_Ungroup_l4->width = 1;

    ui_g_Ungroup_l5->figure_tpye = 0;
    ui_g_Ungroup_l5->layer = 0;
    ui_g_Ungroup_l5->start_x = 919;
    ui_g_Ungroup_l5->start_y = 432;
    ui_g_Ungroup_l5->end_x = 919;
    ui_g_Ungroup_l5->end_y = 631;
    ui_g_Ungroup_l5->color = 2;
    ui_g_Ungroup_l5->width = 3;


    CAT(ui_proc_, CAT(FRAME_OBJ_NUM, _frame))(&ui_g_Ungroup_0);
    SEND_MESSAGE((uint8_t *) &ui_g_Ungroup_0, sizeof(ui_g_Ungroup_0));
}

void _ui_update_g_Ungroup_0() {
    for (int i = 0; i < OBJ_NUM; i++) {
        ui_g_Ungroup_0.data[i].operate_tpyel = 2;
    }

    CAT(ui_proc_, CAT(FRAME_OBJ_NUM, _frame))(&ui_g_Ungroup_0);
    SEND_MESSAGE((uint8_t *) &ui_g_Ungroup_0, sizeof(ui_g_Ungroup_0));
}

void _ui_remove_g_Ungroup_0() {
    for (int i = 0; i < OBJ_NUM; i++) {
        ui_g_Ungroup_0.data[i].operate_tpyel = 3;
    }

    CAT(ui_proc_, CAT(FRAME_OBJ_NUM, _frame))(&ui_g_Ungroup_0);
    SEND_MESSAGE((uint8_t *) &ui_g_Ungroup_0, sizeof(ui_g_Ungroup_0));
}
